﻿using SuddenDeath.Domain.Services.FileManager.elFinder.Utils;

namespace SuddenDeath.Domain.Services.FileManager.elFinder
{
    public class Cwd
    {
        public string name { get; set; }

        public string hash { get; set; }

        public string rel { get; set; }

        public string date { get; set; }

        public string mime { get { return "directory"; } }

        public int size { get; set; }

        public bool read { get; set; }

        public bool write { get; set; }

        public bool rm { get; set; }        

        public Cwd(System.IO.DirectoryInfo dir)
        {
            date = dir.LastWriteTime.ToShortDateString();
            name = dir.Name;
            read = write = rm = true;
            hash = dir.FullName.Hash();
            size = 10;
            rel = dir.PathFromRoot();
        }
    }
}
